package org.truenewx.tnxjeex.unit.model;

import javax.measure.quantity.Time;

import org.truenewx.tnxjee.core.caption.Caption;
import org.truenewx.tnxjee.core.enums.annotation.SimpleEnumType;
import org.truenewx.tnxjeex.unit.support.MeasureUnits;
import org.truenewx.tnxjeex.unit.util.UnitTypes;
import tech.units.indriya.unit.Units;

/**
 * 时间单位
 */
@Caption("时间单位")
@SimpleEnumType(name = UnitTypes.TIME)
public interface TimeUnit extends MeasureUnit<Time> {

    @Caption("年")
    TimeUnit YEAR = MeasureUnits.getInstance().add(Units.YEAR, TimeUnit.class, "Y", "YEAR", "TY");

    @Caption("季度")
    TimeUnit QUARTER = MeasureUnits.getInstance().divide(YEAR, 4, "Q", "QUARTER", "TQ");

    @Caption("月")
    TimeUnit MONTH = MeasureUnits.getInstance().add(Units.MONTH, TimeUnit.class, "M", "MONTH", "TM");

    @Caption("周")
    TimeUnit WEEK = MeasureUnits.getInstance().add(Units.WEEK, TimeUnit.class, "W", "WEEK", "TW");

    @Caption("天")
    TimeUnit DAY = MeasureUnits.getInstance().add(Units.DAY, TimeUnit.class, "D", "DAY", "TD");

    @Caption("小时")
    TimeUnit HOUR = MeasureUnits.getInstance().add(Units.HOUR, TimeUnit.class, null, "HOUR", "TH");

    @Caption("分钟")
    TimeUnit MINUTE = MeasureUnits.getInstance().add(Units.MINUTE, TimeUnit.class, null, "MINUTE", "TMIN");

    @Caption("秒")
    TimeUnit SECOND = MeasureUnits.getInstance().add(Units.SECOND, TimeUnit.class, null, "SECOND", "TS");

    @Caption("毫秒")
    TimeUnit MILLISECOND = MeasureUnits.getInstance().divide(SECOND, 1000, "ms", "MILLISECOND", "TMS");

    @Caption("微秒")
    TimeUnit MICROSECOND = MeasureUnits.getInstance().divide(MILLISECOND, 1000, "us", "MICROSECOND", "TUS");

    @Caption("纳秒")
    TimeUnit NANOSECOND = MeasureUnits.getInstance().divide(MICROSECOND, 1000, "ns", "NANOSECOND", "TNS");

}
